﻿@using CoreData
@model IList<Category>
@if (Model.Count() > 0 && Model != null)
{
    <ul class="inner-module">
        @{
    var listParent = Model.Where(x => x.ParentID == Model.First().ParentID);
    foreach (var item in listParent)
    {
            <li class="cat-item"><a href="@Url.RouteUrl("category_details", new { Id = @item.ID, Link = @item.Link })">
                @item.Name</a> @*@{
        var listChild = Model.Where(x => x.ParentID == item.ID);
        if (listChild.Count() > 0)
        {
                    <ul class="child-toggle">
                        @foreach (var objChild in listChild)
                        {
                            <li><a href="@Url.RouteUrl("category_details", new { Id = objChild.ID, Link = objChild.Link })">@objChild.Name</a>
                            </li>
                        }
                    </ul>
        }
                        
                }*@ </li>
    }
        }
    </ul>
}
